package com.atguigu.flink.streamapi.transform;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * Created by Smexy on 2022/11/21
 *
 *  map: 输入1，必须输出1
 */
public class Demo1_Map
{
    public static void main(String[] args) {


        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        env.setParallelism(1);

        env.fromElements(1,2,3)
           .map(num -> num + 1)    //默认取本地环境的cpu数作为 并行度
           .print();

        try {
                    env.execute();
                } catch (Exception e) {
                    e.printStackTrace();
                }

    }
}
